﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JoinParty.BLL;
using ZHDJ.Core;
using ZHDJ.Data.DataCaching;
using ZHDJ.WebPage;
using MySql.Data.MySqlClient;
using System.Data;

namespace JoinParty.Template
{
    public partial class TJoinStep19 : TemplatePage
    {
        /// <summary>
        /// 网站域名
        /// </summary>
        //public string WebHost
        //{
        //    get { return SystemParameterCaching.Get(SystemParameterKey.WebHost); }
        //}
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //img.ImageUrl = WebHost + "/Resource/themes/default/images/JoinParty/dangh.jpg";
                this.LoadData();
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            WordBusiness.Export(this, palWord, "填写入党志愿书.doc");
        }

        public void LoadData()
        {
            this.litContent.Text = GetData();
            //this.litUserName.Text = PartyJoinApplycation.UserName;
        }

        public string GetData()
        {
            var para = new List<MySqlParameter>
            {
                new MySqlParameter()
                {
                    DbType = DbType.String,
                    ParameterName = "AppllicationID",
                    Value = PartyJoinApplycation.AppllicationID
                }
            };
            string sql =
                @"select Remark from tblpartyjoinlinkexample where CurrentStepID='JoinStep19' and AppllicationID=?AppllicationID ORDER BY CreateTime DESC LIMIT 0,1";
            object obj = ZHDJ.Data.MySqlHelper.ExecuteScalar(sql, para.ToArray());
            return obj == null ? "" : obj.ToString();

        }
    }
}